home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Freeware / Miro 1.0 / Miro_Installer.exe / resources / locale / fix-ro-plurals.py < prev    next >
Encoding:
Python Source  |  2007-11-12  |  528 b   |  16 lines

  1. #!/usr/bin/env python
  2.  
  3. import os
  4.  
  5. bad_str = '"Plural-Forms: nplurals=3; plural=((n == 1 ? 0: (((n %\\n"\n"100 > 19) || ((n % 100 == 0) && (n != 0))) ? 2: 1)));\\n"'
  6.  
  7. good_str = '"Plural-Forms: nplurals=3; plural=((n == 1 ? 0: (((n % 100 > 19) || ((n % 100 == 0) && (n != 0))) ? 2: 1)));\\n"'
  8.  
  9. ro_path = os.path.normpath(os.path.join(__file__, '..', 'ro.po'))
  10. content = open(ro_path).read()
  11. if bad_str in content:
  12.     print 'fixing ro.po'
  13.     f = open(ro_path, 'wt')
  14.     f.write(content.replace(bad_str, good_str))
  15.     f.close()
  16.